<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="demo">
        <p v-if="ok">成功了</p>
        <p v-else>失败</p>

        <p v-show="ok">表白成功</p>
        <p>表白失败</p>

        <button @click="ok=!ok">切换</button>
    </div>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript">
        new Vue ({
            el:'#demo',
            data:{
                ok:false
            }
        })
    </script>
</body>
</html>